function Location() {
	this.items	= {
/*	'0':{1:'北京市',108:'河北省'},
	'0,1':{2:'北京市'},
	'0,1,2':{3:'东城区',4:'西城区',5:'崇文区',6:'宣武区',7:'朝阳区',8:'丰台区',9:'石景山区',10:'海淀区',11:'门头沟区',12:'房山区',13:'通州区',14:'顺义区',15:'昌平区',16:'大兴区',17:'怀柔区',18:'平谷区',19:'密云县',20:'延庆县',21:'延庆镇'},
	'0,108':{109:'石家庄市',145:'张家口市'},
	'0,108,109':{110:'长安区',111:'桥东区',112:'桥西区',113:'新华区',114:'裕华区',115:'井陉矿区',116:'辛集市',117:'藁城市',118:'晋州市',119:'新乐市',120:'鹿泉市',121:'井陉县',122:'微水镇',123:'正定县',124:'正定镇',125:'栾城县',126:'栾城镇',127:'行唐县',128:'龙州镇',129:'灵寿县',130:'灵寿镇',131:'高邑县',132:'高邑镇',133:'深泽县',134:'深泽镇',135:'赞皇县',136:'赞皇镇',137:'无极县',138:'无极镇',139:'平山县',140:'平山镇',141:'元氏县',142:'槐阳镇',143:'赵县',144:'赵州镇'},
	'0,108,145':{146:'桥西区',147:'桥东区',148:'宣化区',149:'下花园区',150:'宣化县',151:'张家口市宣化区',152:'张北县',153:'张北镇',154:'康保县',155:'康保镇',156:'沽源县',157:'平定堡镇',158:'尚义县',159:'南壕堑镇',160:'蔚县',161:'蔚州镇',162:'阳原县',163:'西城镇',164:'怀安县',165:'柴沟堡镇',166:'万全县',167:'孔家庄镇',168:'怀来县',169:'沙城镇',170:'涿鹿县',171:'涿鹿镇',172:'赤城县',173:'赤城镇',174:'崇礼县',175:'西湾子镇'},*/
	'0':{'interface':'interface','arp':'arp', 'mac-address':'mac-address'},
	'0,interface':{'brief':'brief', 'GigabitEthernet 1/0/1':'GigabitEthernet 1/0/1'},
	};
}

Location.prototype.find	= function(id) {
	if(typeof(this.items[id]) == "undefined")
		return false;
	return this.items[id];
}

Location.prototype.fillOption	= function(el_id , loc_id , selected_id) {
	var el	= $('#'+el_id); 
	var json	= this.find(loc_id); 
	if (json) {
		var index	= 1;
		var selected_index	= 0;
		$.each(json , function(k , v) {
			var option	= '<option value="'+k+'">'+v+'</option>';
			el.append(option);
			
			if (k == selected_id) {
				selected_index	= index;
			}
			
			index++;
		})
		//el.attr('selectedIndex' , selected_index); 
	}
	el.select2("val", "");
}

